<?php
	session_start();
	require_once('tools/header.php');
?>

<!DOCTYPE html>
<html>
<head>
<title>喜欢海</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.min.js"></script>
<!-- Custom Theme files -->
<!--theme-style-->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />	
<!--//theme-style-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Whizz Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!--flexslider-->
<link rel="stylesheet" href="css/flexslider.css" type="text/css" media="screen" />
<!--//flexslider-->
</head>
<body>
<!--header-->
<div class="header">
	<div class="container">
		<div class="header-top">
		<div class="top-nav">
			<span class="menu"><img src="images/menu.png" alt=""> </span>
				<ul>
					<li ><a href="index.php" class="color"><i class="glyphicon glyphicon-home"></i>  </a> </li>
					<li><a href="portfolio.php"   class="hvr-bounce-to-top">分类照片</a></li>
<!--					<li ><a href="404.php" class="hvr-bounce-to-top">暂定 </a> </li>-->
					<li><a href="blog.php"  class="hvr-bounce-to-top">博客 </a></li>
					<li><a href="about.php"  class="hvr-bounce-to-top">关于我 </a></li>
<!--					<li><a href="typo.php"  class="hvr-bounce-to-top">Typo </a></li>-->
					<li><a href="contact.php"  class="hvr-bounce-to-top">联系我 </a></li>
				<div class="clearfix"> </div>
				</ul>
					<!--script-->
				<script>
					$("span.menu").click(function(){
						$(".top-nav ul").slideToggle(500, function(){
						});
					});
			</script>	
		</div>
<!--		 <div class="search-in" >-->
<!--			<div class="search" >-->
<!--				<form >-->
<!--					<input type="text"  class="text">-->
<!--					<input type="submit" value="SEARCH">-->
<!--				</form>-->
<!--				<div class="close-in"><img src="images/close.png" alt="" /></div>-->
<!--			</div>-->
<!--			<div class="right"><button> </button></div>-->
<!--		</div>-->
			<script type="text/javascript">
				$('.search').hide();
				$('button').click(function (){
				$('.search').show();
				$('.text').focus();
				}
				);
				$('.close-in').click(function(){
				$('.search').hide();
				});
			</script>
			<div class="clearfix"> </div>
		</div>
		<div class="logo">
			<a href="index.php"><img src="images/logo.png" alt="">	</a>
		</div>
	</div>
</div>
<!--//header-->
<!--content-->
<div class="content">
	<div class="container">
		<div class="content-welcome">
			<div class="col-md-4 red">
					<a href="single.php"><img class="img-responsive" src="images/ab.jpg" alt=""></a>
				</div>
				<div class="col-md-8 come">
					<div class=" welcome">
						<h1>What I Do </h1>
						<h5 class="for">I'm a university student, here is just my personal life in some of the travel records.</h5>
								<p>My life is very simple. Every day, except for the normal course study, I like playing QQ2D snooker at night.
									When my weekend is free, I like travel around the city. If you have the same hobby, maybe you can talk to me.</p>
					</div>
				</div>
				
				<div class="clearfix"> </div>
		
			</div>
			</div>

<!--	服务类别展示，暂且不需要，直接注释-->
<!--			<div class="services">-->
<!--				<div class="container">-->
<!--					<h2>Services</h2>-->
<!--					<div class="service-top">-->
<!--						<div class="col-md-3 top-service">-->
<!--							<i> </i>-->
<!--							<h5>Consectetur adipisicing elit</h5>-->
<!--							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>-->
<!--						</div>-->
<!--						<div class="col-md-3 top-service">-->
<!--							<i class="ic"> </i>-->
<!--							<h5>Consectetur adipisicing elit</h5>-->
<!--							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>-->
<!--						</div>-->
<!--						<div class="col-md-3 top-service">-->
<!--							<i class="ic1"> </i>-->
<!--							<h5>Consectetur adipisicing elit</h5>-->
<!--							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>-->
<!--						</div>-->
<!--						<div class="col-md-3 top-service">-->
<!--							<i class="ic2"> </i>-->
<!--							<h5>Consectetur adipisicing elit</h5>-->
<!--							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>-->
<!--						</div>-->
<!--						<div class="clearfix"> </div>-->
<!--					</div>-->
<!--					<div class="service-top">-->
<!--						<div class="col-md-3 top-service">-->
<!--							<i class="ic3"> </i>-->
<!--							<h5>Consectetur adipisicing elit</h5>-->
<!--							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>-->
<!--						</div>-->
<!--						<div class="col-md-3 top-service">-->
<!--							<i class="ic4"> </i>-->
<!--							<h5>Consectetur adipisicing elit</h5>-->
<!--							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>-->
<!--						</div>-->
<!--						<div class="col-md-3 top-service">-->
<!--							<i class="ic5"> </i>-->
<!--							<h5>Consectetur adipisicing elit</h5>-->
<!--							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>-->
<!--						</div>-->
<!--						<div class="col-md-3 top-service">-->
<!--							<i class="ic6"> </i>-->
<!--							<h5>Consectetur adipisicing elit</h5>-->
<!--							<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>-->
<!--						</div>-->
<!--						<div class="clearfix"> </div>-->
<!--					</div>-->
<!--				</div>-->
<!--			</div>-->
		
		<!--news-->
	<div class="container">
		<div class=" grid-middle">
			<h3>Latest-News</h3>
			<?php
				$sql = "select *  from article order by article_date desc limit 4";
				$stmt = $db->prepare($sql);
				$stmt->execute();

				$result = $stmt->fetchAll(PDO::FETCH_BOTH);

				for($i = 0; $i < sizeof($result); $i = $i + 2){
//					echo($result[$i][0].'<br>');
					?>
					<div class="news-top">
						<div class=" col-md-6 latest-grid">
							<div class="col-md-9 news-in">
								<h5><a href="single.php?id=<?=$result[$i][0]?>"><?=$result[$i][1]?></a></h5>
								<p><?php
										$str = mb_substr($result[$i][5], 0, 180);
										echo $str;
									?></p>
							</div>
							<div class="col-md-3 news">
								<h4><?php
										$str2 = substr($result[$i][2], 8, 2);
										echo $str2;
									?>
									<span>
										<?php
										$str3 = substr($result[$i][2], 5, 2);
										echo $str3;
										?>
									</span></h4>
							</div>
							<div class="clearfix"> </div>
						</div>
						<div class=" col-md-6 latest-grid">
							<div class="col-md-3 news">
								<h4>
									<?php
										$str4 = substr($result[$i + 1][2], 8, 2);
										echo $str4;
									?>
									<span>
										<?php
											$str5 = substr($result[$i + 1][2], 5, 2);
											echo $str5;
										?>
									</span>
								</h4>
							</div>
							<div class="col-md-9 news-in in-news">
								<h5><a href="single.php?id=<?=$result[$i + 1][0]?>"><?=$result[$i + 1][1]?></a></h5>
								<p><?php
										$str6 = mb_substr($result[$i][5], 0, 180);
										echo $str6;
									?></p>
							</div>
							<div class="clearfix"> </div>
						</div>
						<div class="clearfix"> </div>
					</div>

				<?php
				}
			?>
		</div>

<!--content-top-->	
		<div class="content-top">
			<?php
				$sql2 = "select * from article order by article_rq desc limit 3";
				$stmt2 = $db->prepare($sql2);
				$stmt2->execute();

				$result2 = $stmt2->fetchAll(PDO::FETCH_ASSOC);

				foreach($result2 as $k){
					$picStr = $k['article_pictures'];
					$picArr = explode(';', $picStr);
					$picUrl = 'articlePictures/'.$picArr[0];
				?>
					<div class="col-md-4 top-content">
						<a href="single.php"><img style="width: 436px; height: 290px" class="img-responsive" src="<?=$picUrl?>" alt=""></a>
						<h4><a href="single.php?id=<?=$k['article_id']?>"><?=$k['article_title']?></a></h4>
						<p>
							<?php
								$subArticle = mb_substr($k['article_context'], 0, 90);
								echo $subArticle;
							?>
						</p>
					</div>
			<?php
				}
			?>


<!--			<div class="col-md-4 top-content">-->
<!--				<a href="single.php"><img class="img-responsive" src="images/pic1.jpg" alt=""></a>-->
<!--				<h4><a href="single.php">Consectetur adipisicing elit</a></h4>-->
<!--				<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>-->
<!--			</div>-->
<!---->
<!--			<div class="col-md-4 top-content">-->
<!--				<a href="single.php"><img class="img-responsive" src="images/pic2.jpg" alt=""></a>-->
<!--				<h4><a href="single.php">Consectetur adipisicing elit</a></h4>-->
<!--				<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.</p>-->
<!--			</div>-->
			<div class="clearfix"> </div>
		</div>
	</div>
		<!--//content-top-->
		<div class="contact-me">
			<div class="container">
				<h3>Contact Me</h3>
				<div class="contact-top">
					<div class="col-md-3 contact-fax">
						<i class="glyphicon glyphicon-map-marker"></i>
						<p>Anhui</p>
					</div>
					<div class="col-md-3 contact-fax">
						<i class="glyphicon glyphicon-phone"></i>
						<p>+qq1437330892</p>
					</div>
					<div class="col-md-3 contact-fax">
						<a href="#"><i class="glyphicon glyphicon-envelope"></i></a>
						<p><a href="mailto:@example.com">1437330892@qq.com</a> </p>
					</div>
					<div class="col-md-3 contact-fax">
						<i class="glyphicon glyphicon-print"></i>
						<p>Contrary to popular</p>
					</div>
					<div class="clearfix"> </div>
				</div>
			</div>
		</div>
</div>
<!--//content-->
<div class="footer">
		<div class="container">
				<div class="footer-class">
				<div class="col-md-10 class-footer">
					<ul>
						<li ><a href="index.php" >首页</a> </li>
						<li><a href="portfolio.php" >分类照片</a></li>
<!--						<li ><a href="404.php" >Tours </a> </li>-->
						<li><a href="blog.php" >博客 </a></li>
						<li><a href="about.php" >关于我 </a></li>
<!--						<li><a href="typo.php" >Typo </a></li>-->
						<li><a href="contact.php" >联系我 </a></li>
						<li><a href="tools/doAction.php?action=checkCookies" >进入后台管理 </a></li>
					</ul>
					 <p class="footer-grid">Copyright &copy; 2017.Company name All rights reserved.</p>
				</div>	
				<div class="col-md-2"> 
					 <ul class="social">
						<li ><a href="#"><i> </i></a></li>
						<li ><a href="#"><i class="facebook"> </i></a></li>
						<li ><a href="#"><i class="google"> </i></a></li>
					</ul>
				</div>
				<div class="clearfix"> </div>
			 	</div>
		 </div>
		
	</div>
</body>
</html>